home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume14 / sccs_b / part01 next >
Encoding:
Text File  |  1990-09-20  |  25.2 KB  |  795 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: bts!bill
  3. subject: v14i101: simple sysV sccs front end
  4. from: bts!bill
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 14, Issue 101
  8. Submitted-by: bts!bill
  9. Archive-name: sccs_b/part01
  10.  
  11. I have been using the following sccs scripts for at least a year with
  12. no changes or problems.  These are intended to provide a simple front
  13. end to the basic sccs admin, edit, get and diff operations.  I have
  14. added an install operation that just "makes sure" the desired file is
  15. present.  Each script makes a backup source file copy prior to
  16. attempting any sccs operations.  
  17.  
  18. --------- cut here -----------------------------------
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of shell archive."
  26. # Contents:  README Make_Templ Makefile sccs_admin sccs_delta sccs_edit
  27. #   sccs_get sccs_install
  28. # Wrapped by bill@bts on Sun Sep 16 20:09:50 1990
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'README' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'README'\"
  32. else
  33. echo shar: Extracting \"'README'\" \(876 characters\)
  34. sed "s/^X//" >'README' <<'END_OF_FILE'
  35. The following shell scripts are a simple, user friendly front end
  36. to SYS V.3 sccs.  The assumed directory structure is as follows:
  37. X
  38. X    ${PROJECTDIR:-./}
  39. X            | SCCS
  40. X            | src_backup
  41. X
  42. The directory SCCS contains all of the p.* and s.* files created by sccs.
  43. XEach source file is copied to the src_backup directory BEFORE any SCCS
  44. operations are attempted.  Attempts to do an sccs operation that might
  45. result in a trashed sccs file are aborted with a message which identifies
  46. the problem and recommends corrective action.  If an sccs operation does
  47. somehow trash the SCCS file, then the latest source version will always
  48. be available from the src_backup directory.
  49. X
  50. A template Makefile is included to illustrate the typical use of these
  51. sccs scripts
  52. X
  53. Bill Hatch
  54. Coleman Research Corporation
  55. X14504 Greenview Drive Suite 500
  56. Laurel, Maryland 20708
  57. Phone (301)470-3839
  58. XFAX (301)776-5461
  59. END_OF_FILE
  60. if test 876 -ne `wc -c <'README'`; then
  61.     echo shar: \"'README'\" unpacked with wrong size!
  62. fi
  63. # end of 'README'
  64. fi
  65. if test -f 'Make_Templ' -a "${1}" != "-c" ; then 
  66.   echo shar: Will not clobber existing file \"'Make_Templ'\"
  67. else
  68. echo shar: Extracting \"'Make_Templ'\" \(7067 characters\)
  69. sed "s/^X//" >'Make_Templ' <<'END_OF_FILE'
  70. X#  @(#)Makefile.
  71. X#
  72. X#    Makefile        (a Makefile template)
  73. X#
  74. X#    PROGRAM(s)  : 
  75. X#
  76. X#    LIBRARY(s)  : 
  77. X#
  78. X#    DATE        : 
  79. X#
  80. X#    AUTHOR      : W.Hatch 
  81. X#
  82. X#    PROJECT     : WEH Software
  83. X#            
  84. X#    COMPANY : Coleman Research
  85. X#          14504 Greenview Drive Suite 500
  86. X#          Laurel, Maryland 20708
  87. X#          Phone (301)470-3839
  88. X#          FAX (301)776-5461
  89. X#
  90. X#
  91. X#    This Makefile template assumes that the following shell scripts
  92. X#    are installed in one of the user's PATH directories
  93. X#
  94. X#        sccs_admin  arg1  arg2  ...
  95. X#        sccs_get   arg1  arg2  ...
  96. X#        sccs_delta arg1  arg2  ...
  97. X#        sccs_edit  arg1  arg2  ...
  98. X#        sccs_install arg1  arg2  ..
  99. X#
  100. X#    where arg1  arg2  ....  are the names of SRC, SCRIPT and HEADERS
  101. X#    files on which the sccs operations will be performed.
  102. X#
  103. X#    These scripts are used to "hide" the differences between System V.3
  104. X#    and BSD 4.3 SCCS utility interfaces.
  105. X#--------------------------------------------------------------------------
  106. X
  107. X#--------------------------------------------------------------------------
  108. X#  1. define symbolic constants
  109. X#
  110. X#    root directory for this activity
  111. ROOT=/usr/local
  112. X#
  113. X#    relocatable library directory
  114. LIBDIR=$(ROOT)/lib
  115. X#
  116. X#    target directory for executables
  117. BIN=$(ROOT)/bin
  118. X#
  119. X#    documentation target directory
  120. MAN=$(ROOT)/man
  121. MAN1=$(MAN)/man1
  122. MAN3=$(MAN)/man3
  123. X#
  124. X#    target directory for header files
  125. INCLUDE=$(ROOT)/include
  126. X#
  127. X#    list of relocatable libraries required in link step
  128. LIBS=$(ROOT)/lib/libdbug.a \
  129. X     /usr/local/lib/gcc-gnulib /lib/libm.a
  130. X#
  131. X#    list of header files, subject to change, on which *.o depend
  132. HEADERS=
  133. X#
  134. X#    list of source files to be compiled
  135. SRC= 
  136. X#
  137. X#    list of object files to be linked
  138. OBJ=
  139. X#
  140. X#    compile options
  141. CC=cc
  142. X#CC=gcc
  143. AS=/bin/as
  144. X#LD=/bin/ld /lib/crt0.o
  145. X#LD=gcc
  146. LD=/bin/ld
  147. AR=/bin/ar
  148. GCFLAGS=-W -Wunused -Wcomment -Wshadow  -c -g -I$(INCLUDE) -B/usr/local/lib/gcc-
  149. CFLAGS=-g -I$(INCLUDE) -I./ -DM_XENIX
  150. X#
  151. X#    link/load flags
  152. LFLAGS=
  153. X#
  154. X#    executable file to be created (assume only 1)
  155. XEXE=
  156. X#
  157. X#    list of shell script files maintained with this makefile
  158. SCRIPT=
  159. X#
  160. X#    list of manual pages
  161. MANPAGES=
  162. X#
  163. X#    list of all junk files that might occur in this directory
  164. JUNK=core a.out JOURNAL LINT paste.txt error.log dbg_jnl* CHECK CCHK CFLOW \
  165. X    MCCABE KDSI *PRINT GLINT CXREF TJ *.s tr.*
  166. X
  167. X#pretty_printer= *** YOUR FAVORITE PRETTY PRINTER *****
  168. X#--------------------------------------------------------------------------
  169. X#  2. link and load to create the executable
  170. X#--------------------------------------------------------------------------
  171. X$(EXE):  $(OBJ)  $(LIBS)
  172. X    $(CC) -o $(EXE) $(OBJ) $(LIBS)
  173. X
  174. X#--------------------------------------------------------------------------
  175. X#  3. install all objects of this make
  176. X#--------------------------------------------------------------------------
  177. install:  $(EXE) $(SCRIPT) 
  178. X    strip $(EXE)
  179. X    for i in $(EXE) $(SCRIPT); do \
  180. X        chmod ugo+x $$i; \
  181. X        cp $$i  $(BIN); \
  182. X    done
  183. X    rm $(EXE)
  184. X
  185. X#--------------------------------------------------------------------------
  186. X#  4. lint for syntax check on all C source, headers
  187. X#--------------------------------------------------------------------------
  188. LINT:  $(SRC)  $(HEADERS)
  189. X    lint  -DM_XENIX -I./ -I$(INCLUDE) $(SRC) >LINT 2>LINT2
  190. X    cat LINT2 >> LINT
  191. X    rm LINT2
  192. X
  193. GLINT: $(SRC) $(HEADERS)
  194. X    gcc $(GCFLAGS) $(SRC) >GLINT 2>GLINT2
  195. X    cat GLINT2 >> GLINT
  196. X    rm -f GLINT2
  197. X#--------------------------------------------------------------------------
  198. X#  5. tidy up by getting rid of all junk files
  199. X#--------------------------------------------------------------------------
  200. tidy:
  201. X    rm -f $(JUNK)
  202. X
  203. X#--------------------------------------------------------------------------
  204. X#  6. clean up by removing all vestiges of previous makes
  205. X#--------------------------------------------------------------------------
  206. clean:  tidy admin delta
  207. X    rm -f $(EXE)
  208. X    rm -f *.o *.s
  209. X
  210. X#--------------------------------------------------------------------------
  211. X#  7. uninstall all installed targets of this make
  212. X#    (remove any installed manual pages also)
  213. X#--------------------------------------------------------------------------
  214. uninstall:  clean
  215. X    for i in $(EXE) $(SCRIPT); do; \
  216. X        rm -f $(BIN)/$$i; \
  217. X    done
  218. X    for i in $(MANPAGES); do; \
  219. X        rm -f $(MAN1)/$$i; \
  220. X    done
  221. X
  222. X#--------------------------------------------------------------------------
  223. X#  8. individual dependencies for C source files as per the following 
  224. X#     example:
  225. X#
  226. X#    foobar.c:  SCCS/s.foobar.c
  227. X#        sccs_get foobar.c
  228. X#
  229. X#--------------------------------------------------------------------------
  230. X
  231. X#--------------------------------------------------------------------------
  232. X#  9.  individual dependencies for relocatable object files as per
  233. X#    the following example:
  234. X#
  235. X#    foobar.o:  foobar.c  $(HEADERS)
  236. X#        cc -O -c foobar.c
  237. X#
  238. X#--------------------------------------------------------------------------
  239. X#.c.o:
  240. X#    $(CC) $(CFLAGS) -c -S $< 
  241. X#    $(AS) $*.s
  242. X
  243. X$(SRC) $(HEADERS):
  244. X    sccs_install $(SRC) $(HEADERS)
  245. X
  246. X#--------------------------------------------------------------------------
  247. X#  10. individual dependencies for shell script and on line documentation
  248. X#      as per the following example:
  249. X#
  250. X#    textfile: SCCS/s.textfile
  251. X#        sccs_get textfile
  252. X#
  253. X#--------------------------------------------------------------------------
  254. X#--------------------------------------------------------------------------
  255. X#  11. initialize SCCS administration of the source files
  256. X#--------------------------------------------------------------------------
  257. admin:
  258. X    sccs_admin  $(SRC) $(HEADERS) $(SCRIPT) $(MANPAGES)
  259. X
  260. X
  261. X#--------------------------------------------------------------------------
  262. X#  12. edit - get all of the source files ready to edit
  263. X#--------------------------------------------------------------------------
  264. edit:
  265. X    sccs_edit $(SRC) $(SCRIPT) $(HEADERS) $(MANPAGES)
  266. X
  267. X#--------------------------------------------------------------------------
  268. X#  13. get - get all of source files in read only form
  269. X#--------------------------------------------------------------------------
  270. get:
  271. X    sccs_get  $(SRC) $(SCRIPT) $(HEADERS) $(MANPAGES)
  272. X
  273. X#--------------------------------------------------------------------------
  274. X#  14. delta - SCCS delta all source
  275. X#--------------------------------------------------------------------------
  276. delta:
  277. X    sccs_delta  $(SRC) $(SCRIPT) $(HEADERS) $(MANPAGES)
  278. X
  279. X#--------------------------------------------------------------------------
  280. X# 14. print all source files
  281. X#--------------------------------------------------------------------------
  282. print: $(SRC) $(HEADERS) LINT CFLOW CXREF
  283. X    ${pretty_printer} CFLOW $(HEADERS) $(SRC) Makefile CXREF LINT
  284. X
  285. X#--------------------------------------------------------------------------
  286. X# 16. manual page installation
  287. X#    copy manual pages to $(MAN1) and $(MAN3) 
  288. X#--------------------------------------------------------------------------
  289. manual: $(MANPAGES)
  290. X    cp $(MANPAGES) $(MAN1)
  291. X
  292. X#--------------------------------------------------------------------------
  293. X# 18. static analysis of code
  294. X#--------------------------------------------------------------------------
  295. CFLOW: $(SRC) $(HEADERS)
  296. X    cflow -I$(INCLUDE) -I./ -ix $(SRC) >CFLOW
  297. X
  298. CXREF: $(SRC) $(HEADERS)
  299. X    cxref -I$(INCLUDE) -I./ -DM_XENIX $(SRC) >CXREF
  300. X
  301. END_OF_FILE
  302. if test 7067 -ne `wc -c <'Make_Templ'`; then
  303.     echo shar: \"'Make_Templ'\" unpacked with wrong size!
  304. fi
  305. # end of 'Make_Templ'
  306. fi
  307. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  308.   echo shar: Will not clobber existing file \"'Makefile'\"
  309. else
  310. echo shar: Extracting \"'Makefile'\" \(1890 characters\)
  311. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  312. X#  sccsid="%W% %G% %U%";
  313. X#
  314. X#    Makefile.sccs
  315. X#
  316. X#    PROGRAM(s)  : sccs_admin, sccs_edit, sccs_get, sccs_delta, sccs_install
  317. X#    AUTHOR        : W. Hatch
  318. X#            Coleman Research
  319. X#            14504 Greenview Drive Suite 500
  320. X#            Laurel, Maryland 20708
  321. X#            (301)470-3839
  322. X#            uunet!bts!bill
  323. X#    DATE        : 7/19/88
  324. X#    PROJECT        : WEH Software
  325. X#
  326. X#    This Makefile template assumes that the following shell scripts
  327. X#    are installed in one of the user's PATH directories
  328. X#
  329. X#--------------------------------------------------------------------------
  330. X
  331. X#--------------------------------------------------------------------------
  332. X#  1. define symbolic constants
  333. X#
  334. X#    root directory for this activity
  335. ROOT=/usr/local
  336. X#
  337. X#    target directory for executables
  338. BIN=$(ROOT)/bin
  339. X#
  340. X#    documentation target directory
  341. DOCINSTALL=$(ROOT)/doc
  342. X#
  343. X#    list of shell script files maintained with this makefile
  344. SCRIPT= sccs_admin sccs_delta sccs_edit sccs_get sccs_install
  345. X#
  346. X#    list of all junk files that might occur in this directory
  347. JUNK=core a.out JOURNAL LINT paste.txt error.log dbg_jnl*
  348. X
  349. X
  350. X#--------------------------------------------------------------------------
  351. X#  4. install all objects of this make
  352. X#--------------------------------------------------------------------------
  353. install:  $(SCRIPT) $(DOC)
  354. X    for i in  $(SCRIPT); do \
  355. X        chmod ugo+x $$i; \
  356. X        cp $$i  $(BIN); \
  357. X    done
  358. X    #cp $(DOC) $(DOCINSTALL)
  359. X
  360. X#--------------------------------------------------------------------------
  361. X#  8. uninstall all installed targets of this make
  362. X#--------------------------------------------------------------------------
  363. uninstall:
  364. X    for i in  $(SCRIPT); do; \
  365. X        rm -f $(BIN)/$$i; \
  366. X    done
  367. X    #for i in $(DOC); do; \
  368. X    #    rm -f $(DOCINSTALL)/$$i; \
  369. X    #done
  370. X
  371. X#--------------------------------------------------------------------------
  372. X#  15. print all source
  373. X#--------------------------------------------------------------------------
  374. print:
  375. X    pf $(SCRIPT) Makefile
  376. END_OF_FILE
  377. if test 1890 -ne `wc -c <'Makefile'`; then
  378.     echo shar: \"'Makefile'\" unpacked with wrong size!
  379. fi
  380. # end of 'Makefile'
  381. fi
  382. if test -f 'sccs_admin' -a "${1}" != "-c" ; then 
  383.   echo shar: Will not clobber existing file \"'sccs_admin'\"
  384. else
  385. echo shar: Extracting \"'sccs_admin'\" \(2507 characters\)
  386. sed "s/^X//" >'sccs_admin' <<'END_OF_FILE'
  387. X#!/bin/sh
  388. X#+++
  389. X#    NAME    : sccs_admin
  390. X#    PURPOSE : create SCCS files if they do not already exist
  391. X#    AUTHOR    :  W. Hatch
  392. X#            Coleman Research
  393. X#            14504 Greenview Drive Suite 500
  394. X#            Laurel, Maryland 20708
  395. X#            (301)470-3839
  396. X#            uunet!bis!bill
  397. X#    DATE    : 7/18/88
  398. X#    PROJECT    : WEH SOFTWARE
  399. X#    USAGE    : sccs_admin  file1  file2  ....
  400. X#    RESTRICTIONS : file name length <= 12 characters for Unix V.3
  401. X#---
  402. X#------------------------------------------------------------------------
  403. X# if no command line arguments then abort with usage instructions
  404. X#------------------------------------------------------------------------
  405. usage="  "
  406. case $# in
  407. X    0) echo $usage
  408. X       exit;;
  409. esac
  410. X#------------------------------------------------------------------------
  411. X# if project directory is not defined then make it the current directory
  412. X#------------------------------------------------------------------------
  413. PROJECTDIR=${PROJECTDIR-.}
  414. X#------------------------------------------------------------------------
  415. X# define sccs and source backup directories relative to project directory
  416. X#------------------------------------------------------------------------
  417. SCCS=$PROJECTDIR/SCCS
  418. BACKUP=$PROJECTDIR/src_backup
  419. export SCCS  PROJECTDIR  BACKUP
  420. X#------------------------------------------------------------------------
  421. X# make sure sccs and source backup directories exist
  422. X#------------------------------------------------------------------------
  423. if test ! -d  $SCCS
  424. then
  425. X    mkdir $SCCS
  426. else
  427. X    echo "$SCCS directory exists."
  428. fi
  429. if test ! -d $BACKUP
  430. then
  431. X    mkdir $BACKUP
  432. else 
  433. X    echo "$BACKUP directory exists."
  434. fi
  435. X#------------------------------------------------------------------------
  436. X# for each source file not already under sccs put it under sccs
  437. X#------------------------------------------------------------------------
  438. for i
  439. do
  440. X    if test ! -f $SCCS/s.$i
  441. X    then
  442. X        #-------------------------------------------------------
  443. X        # if file $i does not exist then abort
  444. X        #-------------------------------------------------------
  445. X        if test ! -s $i
  446. X        then
  447. X            echo "$i does not exist or is zero length; "
  448. X            echo "sccs_admin $i aborted"
  449. X            echo "look in src_backup or elsewhere for $i source"
  450. X            exit 1
  451. X        fi
  452. X        #-------------------------------------------------------
  453. X        # backup before sccs removes original source file
  454. X        #-------------------------------------------------------
  455. X        cp $i $BACKUP/$i
  456. X        admin -i$i $SCCS/s.$i 
  457. X        rm $i
  458. X        echo "admin of $i OK."
  459. X    else
  460. X        echo "$SCCS/s.$i exists;  admin for $i aborted"
  461. X        echo "$i is already under sccs."
  462. X    fi
  463. done
  464. END_OF_FILE
  465. if test 2507 -ne `wc -c <'sccs_admin'`; then
  466.     echo shar: \"'sccs_admin'\" unpacked with wrong size!
  467. fi
  468. chmod +x 'sccs_admin'
  469. # end of 'sccs_admin'
  470. fi
  471. if test -f 'sccs_delta' -a "${1}" != "-c" ; then 
  472.   echo shar: Will not clobber existing file \"'sccs_delta'\"
  473. else
  474. echo shar: Extracting \"'sccs_delta'\" \(2728 characters\)
  475. sed "s/^X//" >'sccs_delta' <<'END_OF_FILE'
  476. X#!/bin/sh
  477. X#+++
  478. X#    NAME    : sccs_delta
  479. X#    PURPOSE : introduce changes to a file under SCCS
  480. X#    AUTHOR    :  W. Hatch
  481. X#            Coleman Research
  482. X#            14504 Greenview Drive Suite 500
  483. X#            Laurel, Maryland 20708
  484. X#            (301)470-3839
  485. X#            uunet!bis!bill
  486. X#    DATE    : 7/18/88
  487. X#    PROJECT    : WEH SOFTWARE
  488. X#    USAGE    : sccs_delta  file1  file2  ....
  489. X#    RESTRICTIONS : file name lengths must be <= 12 characters
  490. X#---
  491. X#------------------------------------------------------------------------
  492. X# if no command line arguments then abort with usage instructions
  493. X#------------------------------------------------------------------------
  494. usage="sccs_delta  file1  file2  ....  "
  495. case $# in
  496. X    0) echo $usage
  497. X       exit;;
  498. esac
  499. X#------------------------------------------------------------------------
  500. X# if project directory is not defined then make it the current directory
  501. X#------------------------------------------------------------------------
  502. PROJECTDIR=${PROJECTDIR-.}
  503. X#------------------------------------------------------------------------
  504. X# define sccs and source backup directories relative to project directory
  505. X#------------------------------------------------------------------------
  506. SCCS=$PROJECTDIR/SCCS
  507. BACKUP=$PROJECTDIR/src_backup
  508. export SCCS  PROJECTDIR BACKUP
  509. X#------------------------------------------------------------------------
  510. X# verify existence of sccs and source backup directories
  511. X#------------------------------------------------------------------------
  512. if test ! -d  $SCCS
  513. then
  514. X    echo "$SCCS does not exist ; "
  515. X    echo "use sccs_admin to create $SCCS"
  516. X    exit 1
  517. fi
  518. if test ! -d $BACKUP
  519. then
  520. X    echo "$BACKUP does not exist;"
  521. X    echo "use sccs_admin to create $BACKUP."
  522. X    exit 1
  523. fi
  524. X
  525. X#------------------------------------------------------------------------
  526. X# perform delta for each requested file that is under sccs
  527. X#------------------------------------------------------------------------
  528. for i
  529. do
  530. X    if test  -s $i
  531. X    then
  532. X        if test  -f $SCCS/s.$i
  533. X        then
  534. X            #-------------------------------------------------------
  535. X            # backup before sccs removes original source file
  536. X            #-------------------------------------------------------
  537. X            if test -w  $i
  538. X            then
  539. X                cp $i $BACKUP/$i
  540. X                echo "delta -y $SCCS/s.$i"
  541. X                delta -y"" $SCCS/s.$i 
  542. X            else
  543. X                echo "no writable $i exists; abort sccs_delta"
  544. X            fi
  545. X        else
  546. X            echo "$SCCS/s.$i does not exist; "
  547. X           echo "you can not delta a file that is not under sccs control."
  548. X            echo "use assc_admin to place $i under sccs control."
  549. X        fi
  550. X    else
  551. X        echo "$i does not exist or is zero size; abort sccs_delta"
  552. X        echo "see rmdel(1) to remove previous deltas and "
  553. X        echo "reconstruct the file from SCCS/s.$i or get a"
  554. X        echo "copy of the file from src_backup.  "
  555. X        echo "BE CAREFUL not to blow away all copies of $i"
  556. X    fi
  557. X    
  558. done
  559. X
  560. END_OF_FILE
  561. if test 2728 -ne `wc -c <'sccs_delta'`; then
  562.     echo shar: \"'sccs_delta'\" unpacked with wrong size!
  563. fi
  564. chmod +x 'sccs_delta'
  565. # end of 'sccs_delta'
  566. fi
  567. if test -f 'sccs_edit' -a "${1}" != "-c" ; then 
  568.   echo shar: Will not clobber existing file \"'sccs_edit'\"
  569. else
  570. echo shar: Extracting \"'sccs_edit'\" \(2542 characters\)
  571. sed "s/^X//" >'sccs_edit' <<'END_OF_FILE'
  572. X#!/bin/sh
  573. X#+++
  574. X#    NAME    : sccs_edit
  575. X#    PURPOSE : get read/write version of files under SCCS
  576. X#    AUTHOR    :  W. Hatch
  577. X#            Coleman Research
  578. X#            14504 Greenview Drive Suite 500
  579. X#            Laurel, Maryland 20708
  580. X#            (301)470-3839
  581. X#            uunet!bis!bill
  582. X#    DATE    : 7/18/88
  583. X#    PROJECT    : WEH SOFTWARE
  584. X#    USAGE    : sccs_edit  file1  file2  ....
  585. X#    RESTRICTIONS : file name lengths must be <= 12 characters
  586. X#---
  587. X#------------------------------------------------------------------------
  588. X# if no command line arguments then abort with usage instructions
  589. X#------------------------------------------------------------------------
  590. usage="sccs_edit  file1  file2  ....  "
  591. case $# in
  592. X    0) echo $usage
  593. X       exit;;
  594. esac
  595. X#------------------------------------------------------------------------
  596. X# if project directory is not defined then make it the current directory
  597. X#------------------------------------------------------------------------
  598. PROJECTDIR=${PROJECTDIR-.}
  599. X#------------------------------------------------------------------------
  600. X# define sccs and source backup directories relative to project directory
  601. X#------------------------------------------------------------------------
  602. SCCS=$PROJECTDIR/SCCS
  603. export SCCS  PROJECTDIR
  604. X#------------------------------------------------------------------------
  605. X# verify existence of sccs directory
  606. X#------------------------------------------------------------------------
  607. if test ! -d  $SCCS
  608. then
  609. X    echo "$SCCS does not exist ; "
  610. X    echo "use sccs_admin to create $SCCS."
  611. X    exit 1
  612. fi
  613. X#------------------------------------------------------------------------
  614. X# get each requested file in editable form if it exists under sccs
  615. X#------------------------------------------------------------------------
  616. for i
  617. do
  618. X    if test  -s $SCCS/s.$i
  619. X    then
  620. X        #-------------------------------------------------------
  621. X        # do not sccs_edit $i if a writable version exists
  622. X        #-------------------------------------------------------
  623. X        if test -w $i
  624. X        then
  625. X            echo "writable $i exists; sccs_edit $i aborted"
  626. X        else 
  627. X            #-------------------------------------------------
  628. X            # if a (non-writable) version exists then remove it
  629. X            #-------------------------------------------------
  630. X            if test -f $i
  631. X            then
  632. X                rm -f $i
  633. X            fi
  634. X            echo "get -p -e -t $SCCS/s.$i > $i"
  635. X            get -p -e -t $SCCS/s.$i > $i
  636. X        fi
  637. X    else
  638. X        echo "sccs_edit of $i ABORTED"
  639. X        echo "$SCCS/s.$i does not exist or is zero length; "
  640. X        echo "if SCCS/s.$i exists then delete it and retrieve $i"
  641. X        echo "from src_backup or elsewhere and"
  642. X        echo "use sccs_admin to place $i under sccs administration."
  643. X    fi
  644. done
  645. END_OF_FILE
  646. if test 2542 -ne `wc -c <'sccs_edit'`; then
  647.     echo shar: \"'sccs_edit'\" unpacked with wrong size!
  648. fi
  649. chmod +x 'sccs_edit'
  650. # end of 'sccs_edit'
  651. fi
  652. if test -f 'sccs_get' -a "${1}" != "-c" ; then 
  653.   echo shar: Will not clobber existing file \"'sccs_get'\"
  654. else
  655. echo shar: Extracting \"'sccs_get'\" \(2593 characters\)
  656. sed "s/^X//" >'sccs_get' <<'END_OF_FILE'
  657. X#!/bin/sh
  658. X#+++
  659. X#    NAME    : sccs_get
  660. X#    PURPOSE : get read only version of files under SCCS
  661. X#    AUTHOR    :  W. Hatch
  662. X#            Coleman Research
  663. X#            14504 Greenview Drive Suite 500
  664. X#            Laurel, Maryland 20708
  665. X#            (301)470-3839
  666. X#            uunet!bis!bill
  667. X#    DATE    : 7/18/88
  668. X#    PROJECT    : WEH SOFTWARE
  669. X#    USAGE    : sccs_get  file1  file2  ....
  670. X#    RESTRICTIONS : file name lengths must be <= 12 characters
  671. X#---
  672. X#------------------------------------------------------------------------
  673. X# if no command line arguments then abort with usage instructions
  674. X#------------------------------------------------------------------------
  675. usage="sccs_get  file1  file2  ....  "
  676. case $# in
  677. X    0) echo $usage
  678. X       exit;;
  679. esac
  680. X#------------------------------------------------------------------------
  681. X# if project directory is not defined then make it the current directory
  682. X#------------------------------------------------------------------------
  683. PROJECTDIR=${PROJECTDIR-.}
  684. X#------------------------------------------------------------------------
  685. X# define sccs and source backup directories relative to project directory
  686. X#------------------------------------------------------------------------
  687. SCCS=$PROJECTDIR/SCCS
  688. BACKUP=$PROJECTDIR/src_backup
  689. export SCCS  PROJECTDIR BACKUP
  690. X#------------------------------------------------------------------------
  691. X# verify existence of sccs and source backup directories
  692. X#------------------------------------------------------------------------
  693. if test ! -d  $SCCS
  694. then
  695. X    echo "$SCCS does not exist ; "
  696. X    echo "use sccs_admin to create $SCCS"
  697. X    exit 1
  698. fi
  699. if test ! -d $BACKUP
  700. then
  701. X    echo "$BACKUP does not exist;"
  702. X    echo "use sccs_admin to create $BACKUP."
  703. X    exit 1
  704. fi
  705. X#------------------------------------------------------------------------
  706. X# get each requested file in read only form if it exists under sccs
  707. X#------------------------------------------------------------------------
  708. for i
  709. do
  710. X    #----------------------------------------------------------------
  711. X    # abort the get if a writable version exists
  712. X    # otherwise the file in $PROJECTDIR is trashed    
  713. X    #----------------------------------------------------------------
  714. X    if test -w $i
  715. X    then
  716. X        echo "$i exists for editing; abort sccs_get of $i"
  717. X        echo "make sure $i is not zero length and"
  718. X        echo "use sccs_admin or sccs_delta on writable version of $i"
  719. X        echo "before attempting another sccs_get."
  720. X    else
  721. X        if test  -s $SCCS/s.$i
  722. X        then
  723. X            echo "get -p $SCCS/s.$i > $i; chmod ugo-w $i"
  724. X            get -p $SCCS/s.$i > $i
  725. X            chmod ugo-w $i
  726. X        else
  727. X            echo "$SCCS/s.$i does not exist or is zero length; "
  728. X            echo "use sccs_admin to place $i under sccs."
  729. X                    
  730. X        fi
  731. X    fi
  732. done
  733. X
  734. END_OF_FILE
  735. if test 2593 -ne `wc -c <'sccs_get'`; then
  736.     echo shar: \"'sccs_get'\" unpacked with wrong size!
  737. fi
  738. chmod +x 'sccs_get'
  739. # end of 'sccs_get'
  740. fi
  741. if test -f 'sccs_install' -a "${1}" != "-c" ; then 
  742.   echo shar: Will not clobber existing file \"'sccs_install'\"
  743. else
  744. echo shar: Extracting \"'sccs_install'\" \(838 characters\)
  745. sed "s/^X//" >'sccs_install' <<'END_OF_FILE'
  746. X#!/bin/sh
  747. X#+++
  748. X#    NAME    : sccs_install
  749. X#
  750. X#    PURPOSE : check for presence of a file and, if not present then
  751. X#          sccs_get to install a read only version of the file
  752. X#          if file is present then do nothing
  753. X#
  754. X#    USAGE    : sccs_install file1  file2  ....
  755. X#
  756. X#    DATE    : Sat Mar 10 15:17:21 EST 1990
  757. X#
  758. X#    AUTHOR  : W. Hatch
  759. X#
  760. X#    PROJECT : WEH Software
  761. X#            
  762. X#    COMPANY : Coleman Research
  763. X#          14504 Greenview Drive Suite 500
  764. X#          Laurel, Maryland 20708
  765. X#          Phone (301)470-3839
  766. X#          FAX (301)776-5461
  767. X#
  768. X#------------------------------------------------------------------------
  769. X# if no command line arguments then abort with usage instructions
  770. X#------------------------------------------------------------------------
  771. usage="sccs_install file1  file2  .... "
  772. case $# in
  773. X    0) echo $usage
  774. X       exit;;
  775. esac
  776. X
  777. for i
  778. do
  779. X    if [ ! -f $i ]
  780. X    then
  781. X        sccs_get $i
  782. X    fi
  783. done
  784. END_OF_FILE
  785. if test 838 -ne `wc -c <'sccs_install'`; then
  786.     echo shar: \"'sccs_install'\" unpacked with wrong size!
  787. fi
  788. chmod +x 'sccs_install'
  789. # end of 'sccs_install'
  790. fi
  791. echo shar: End of shell archive.
  792. exit 0
  793.  
  794.  
  795.